class CreatePosts < ActiveRecord::Migration
  def self.up
    create_table :posts do |t|
      t.column :title, :string
      t.column :image, :string
      
      t.column :category_id, :int
      t.timestamps
    end
    
    post1 = Post.create(:title => 'flex A', :category_id => 1)
    post2 = Post.create(:title => 'flex B', :category_id => 1)
    post3 = Post.create(:title => 'flex C', :category_id => 1)
    post4 = Post.create(:title => 'flex D', :category_id => 1)
    post5 = Post.create(:title => 'flex E', :category_id => 1)
    
    room1 = Post.create(:title => 'meeting room', :category_id => 2)
    
    room2 = Post.create(:title => 'conference room', :category_id => 3)
    
  end

  def self.down
    drop_table :posts
  end
end
